package com.xdf.wxbebarrel.model;

import com.thoughtworks.xstream.annotations.XStreamAlias;

import java.util.Map;

public class WechatBaseMassage {
    @XStreamAlias("ToUserName")
    private String toUserName;
    @XStreamAlias("FromUserName")
    private String fromUserName;
    @XStreamAlias("CreateTime")
    private String createTime;
    @XStreamAlias("MsgType")
    private String msgType;

    public WechatBaseMassage(String fromUserName, String toUserName) {
        this.toUserName = toUserName;
        this.fromUserName = fromUserName;
        this.createTime = System.currentTimeMillis()/1000 + "";
    }


    public String getToUserName() {
        return toUserName;
    }
    public void setToUserName(String toUserName) {
        this.toUserName = toUserName;
    }
    public String getFromUserName() {
        return fromUserName;
    }
    public void setFromUserName(String fromUserName) {
        this.fromUserName = fromUserName;
    }
    public String getCreateTime() {
        return createTime;
    }
    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
    public String getMsgType() {
        return msgType;
    }
    public void setMsgType(String msgType) {
        this.msgType = msgType;
    }
    @Override
    public String toString() {
        return "BaseMessage [toUserName=" + toUserName + ", fromUserName=" + fromUserName + ", createTime=" + createTime
                + ", msgType=" + msgType + "]";
    }


    public WechatBaseMassage(Map<String, String> reqMap) {
        this.toUserName = reqMap.get("FromUserName");
        this.fromUserName = reqMap.get("ToUserName");
        this.createTime = System.currentTimeMillis()/1000 + "";
    }
}
